import type { Api } from '@/typings/api';
import { request } from '../request';
/** get user list */
export function fetchGetUserList(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/b/api/user',
    method: 'get',
    params,
  });
}

// 用户数据更新
export function fetchPostUser(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/b/api/user/update',
    method: 'post',
    data,
  });
}

// 用户新增
export function fetchPostAddUser(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/b/api/user/add',
    method: 'post',
    data,
  });
}

// 删除用户
export function fetchPostDeleteUser(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/b/api/user/delete',
    method: 'post',
    data,
  });
}
// 上传
export function fetchUpload(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
}

// 生成列表
export function fetchGetGenerate(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'get',
    params,
  });
}

// 删除生成
export function fetchDeleteGenerate(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'post',
    data,
  });
}

// 克隆角色列表
export function fetchGetVoice(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'get',
    params,
  });
}

// 删除角色
export function fetchDeleteVoice(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'post',
    data,
  });
}

// 操作日志api
export function fetchGetEvent(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/b/api/eventLog',
    method: 'get',
    params,
  });
}

// 音效列表
export function fetchGetSoundEffect(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'get',
    params,
  });
}

// 删除音效
export function fetchDeleteSoundEffect(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'post',
    data,
  });
}

// 首页数据看板
export function fetchGetDataTable(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api/',
    method: 'get',
    params,
  });
}

// 设置tags
export function fetchPostSetTags(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'post',
    data,
  });
}

// 设置banner
export function fetchPostSetBanners(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'post',
    data,
  });
}

// 获取tags和banner配置
export function fetchGetTagsAndBanner(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'get',
    params,
  });
}

// 获取市场声音
export function fetchGetMarketVoice(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'get',
    params,
  });
}

// 修改市场声音审核状态
export function fetchPostVoiceStatus(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: `/api/`,
    method: 'post',
    data: data.model,
  });
}

// 获取市场新声音
export function fetchGetMarketNewVoice(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'get',
    params,
  });
}

// 修改市场新声音审核状态
export function fetchPostVoiceNewStatus(data?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: `/api`,
    method: 'post',
    data: data.model,
  });
}

// 获取总数数据
export function fetchGetDataTotal(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'get',
    params,
  });
}

// 获取总数数据voice
export function fetchGetDataVoiceTotal(params?: Api.User.UserSearchParams) {
  return request<Api.User.UserList>({
    url: '/api',
    method: 'get',
    params,
  });
}
